<?php

class LogEX {
    
    public function __construct($kind=Systeem::LOG_ERROR,$info='') {
        
        $status = 0;
        $sessionId = isset($_SESSION['sessionid'])?$_SESSION['sessionid']:0;
        $timestamp = time();
       try {
           $dbStmt = Db::GET()->prepare("INSERT INTO exlog 
                   (sessionid,kind,info,status,timestamp) VALUES 
                   (:sessionid,:kind,:info,:status,:timestamp)");
           
           $dbStmt->execute([':sessionid'=>$sessionId,
                             ':kind'=>$kind,
                             ':status'=>$status,
                             ':info'=>$info,
                             ':timestamp'=>$timestamp]);
       } 
       catch (PDOException $ex) {

       }
    }
    
}
